import { ColumnProps } from '~/library/components/ProTable/interface'
import { Information } from '~/src/api/interface/information'
import { getDicData } from '~/src/api/systemLog'

// 表格配置项
export const SupplierListColumns: ColumnProps<Information.SupplierList>[] = [
  { type: 'selection', width: 60 },
  { type: 'index', label: '序号', width: 60 },
  { sortable: true, prop: 'name', label: '供应商名称', minWidth: 160, align: 'left', search: { el: 'input' } },
  { sortable: true, prop: 'supplierCode', label: '供应商编码', minWidth: 160, align: 'left' },
  { sortable: true, prop: 'helpCode', label: '助记码', minWidth: 160, align: 'left' },
  {
    sortable: true,
    prop: 'businessType',
    label: '经营方式',
    minWidth: 160,
    enum: () => getDicData('OperateWay'),
    fieldNames: { label: 'description', value: 'value' },
  },
  { sortable: true, prop: 'commissionRate', label: '商户提成率', minWidth: 120, align: 'left' },
  {
    sortable: true,
    prop: 'settleType',
    label: '结账方式',
    minWidth: 120,
    enum: () => getDicData('SettleType'),
    fieldNames: { label: 'description', value: 'value' },
  },
  { prop: 'operation', label: '操作', width: 145, fixed: 'right' },
]
